$(function(){
    new uploadPreview({ UpBtn: "up_img", DivShow: "imgdiv", ImgShow: "imgShow" });
    new uploadPreview({ UpBtn: "up_img_bg", DivShow: "img-bg", ImgShow: "imgbgShow" });
    $('.btn-upimg').eq(0).click(function(){
        $('#up_img').trigger('click');
    });
    $('.btn-upimg').eq(1).click(function(){
        $('#up_img_bg').trigger('click');
    });

    /*
     * 内容图片上传：
     * 服务器地址,成功返回,失败返回参数格式依照jquery.ajax习惯;
     * 其他参数同WebUploader
     */
    $('#test').diyUpload({
        url:'server/fileupload.php',
        success:function( data ) {
            console.info( data );
        },
        error:function( err ) {
            console.info( err );
        }
    });
});